package com.example.doo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");
        User user=context.getBean("user",User.class);
        user.PrintName("doo");

        Student student=context.getBean("student",Student.class);
        System.out.println("姓名:"+student.getPerson().getName());

        UsePhone usePhone= (UsePhone) context.getBean("usePhone");
        usePhone.use();
    }
}
